using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public enum UnitID
{
	Soldier,
	ArchAngel,
	Drake,
	FiveHeadedDragon,
};

public class UnitSpawner : MonoBehaviour 
{
	public Unit[] unit;
	
	public List<Unit> unitList = new List<Unit>();
	
	public void SpawnUnit(SpawnUnitMes mes)
	{
		Unit clone = Instantiate(unit[(int)mes.type]) as Unit;
		clone.Spawn(mes.pos);
		unitList.Add(clone);
	}
	
	public void UpdateUnit(int UnitNum, Vector3 pos)
	{
		unitList[UnitNum].currentPos = pos;
	}
	
	public void DeleteUnit(int UnitNum)
	{
		unitList.RemoveAt(UnitNum);
	}
}
